package com.hwadee.teachingprocessmanagementsystem.config;

import lombok.Getter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * @Description: Redis配置映射类
 * @Author: Jukomu
 * @Package: org.csu.mypetstore.config
 * @Project: MyPetStore-SSM
 * @name: RedisConfigProperties
 * @Date: 2024/4/14 22:39
 * @Filename: RedisConfigProperties
 */
@Getter
@Component
@ConfigurationProperties(prefix = "spring.data.redis")
public class RedisPropertiesConfig {
    // 本地Redis配置
    private Integer timeout;
    private String host;
    private Integer port;
    private String password;
    private Integer database;
    // 远程Redis配置
    private Integer remote_timeout;
    private String remote_host;
    private Integer remote_port;
    private String remote_password;
    private Integer remote_database;

    private Boolean isCluster;
    private cluster cluster;

    @Getter
    public static class cluster {
        private List<String> nodes;

        public void setNodes(List<String> nodes) {
            this.nodes = nodes;
        }
    }

    public void setTimeout(Integer timeout) {
        this.timeout = timeout;
    }

    public void setDatabase(Integer database) {
        this.database = database;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setRemote_timeout(Integer remote_timeout) {
        this.remote_timeout = remote_timeout;
    }

    public void setRemote_host(String remote_host) {
        this.remote_host = remote_host;
    }

    public void setRemote_port(Integer remote_port) {
        this.remote_port = remote_port;
    }

    public void setRemote_password(String remote_password) {
        this.remote_password = remote_password;
    }

    public void setRemote_database(Integer remote_database) {
        this.remote_database = remote_database;
    }

    public void setIsCluster(Boolean isCluster) {
        this.isCluster = isCluster;
    }

    public void setCluster(RedisPropertiesConfig.cluster cluster) {
        this.cluster = cluster;
    }
}



